/**
 * RequestResult.java
 * com.aabill.api
 *
 * Function： TODO 
 *
 *   ver     date      		author
 * ──────────────────────────────────
 *   		 2012-8-14 		wangjieming
 *
 * Copyright (c) 2012, TNT All Rights Reserved.
 */

package com.jamin.aabill.api;

import org.json.JSONException;
import org.json.JSONObject;

import com.jamin.aabill.http.Response;

/**
 * ClassName:RequestResult
 *
 * @author   wangjieming
 * @version  1.0
 * @since    v1.0
 * @Date	 2012-8-14 上午8:19:02 
 */
public class RequestResult {


	private static final int TYPE_BIZOBJ_LIST = 1;
	private static final int TYPE_BIZOBJ_OBJECT = 2;

	/**
	 * Creates a new instance of RequestResult.
	 * @param res
	 * @param type 根据接口需要，设置业务实体TYPE<br>
	 *  TYPE_BIZOBJ_LIST = 1  <br>
	 *  TYPE_BIZOBJ_OBJECT = 2<br>
	 * 
	 */

	public RequestResult(Response res , int type) throws BillException{
		JSONObject jsonObj = res.asJSONObject();
		try {
			requestStatus = new RequestStatus(jsonObj.getJSONObject("status"));
			pageInfo = new RequestPageInfo(jsonObj.getJSONObject("status"));
			switch(type){
			case TYPE_BIZOBJ_LIST:
				break;
			case TYPE_BIZOBJ_OBJECT:
				
				break;
			}
		} catch (JSONException jsone) {
			throw new BillException(jsone.getMessage() , jsone);
		}
	}



	Object bizObject;
	RequestStatus requestStatus;
	RequestPageInfo pageInfo;

	
	public Object getBizObject() {
		return bizObject;
	}
	
	public void setBizObject(Object bizObject) {
		this.bizObject = bizObject;
	}
	
	public RequestStatus getRequestStatus() {
		return requestStatus;
	}
	
	public void setRequestStatus(RequestStatus requestStatus) {
		this.requestStatus = requestStatus;
	}
	
	public RequestPageInfo getPageInfo() {
		return pageInfo;
	}
	
	public void setPageInfo(RequestPageInfo pageInfo) {
		this.pageInfo = pageInfo;
	}
	




}

